#	CompareLastRevision - compare a file with the last revision of it
#
#	Usage:	CompareLastRevision file
#
#	Status:	CompareLastRevision returns the status value from Compare.
#
#	CompareLastRevision runs a compare command with the last revision
#	of a file checked out for modification.
#
#	© Apple Computer, Inc. 1988
#	All rights reserved.

Set Exit 0

For File In {"Parameters"}
	If "{File}" !~ /:*([Â:]+:*)*([Â:]+)¨1/
		Echo "### {0} - Ò{File}Ó: bad file name"
		Continue
	End
	Set Short "{¨1}"

	Set Info "`ProjectInfo "{File}"`"
	If "{Info}" !~ /ÅProject: (Åº)¨1 Å/
		Echo "### {0} - Ò{File}Ó: not part of project"
		Continue
	End
	Set Project "{¨1}"

	CheckOut -d "{Boot}" -project "{Project}" "{Short}"
	Set CheckOutStatus {Status}
	If {CheckOutStatus} != 0
		Echo "### {0} - unable to check out Ò{File}Ó"
		Exit {CheckOutStatus}
	End

	Compare -n -t -x "{Boot}{Short}" "{File}"

	Delete -i "{Boot}{Short}"
End
